import { request } from "umi";

// 获取最新文章列表
export function getArticleList(page: number = 1){
  let params = {
    page,
    pageSize: 6,
  }
  return request('/api/article', {
    params
  });
}

// 获取最新评论列表
export function getCommentList(page: number = 1){
  let params = {
    page,
    pageSize: 6,
  }
  return request('/api/comment', {
    params
  });
}
// 通过拒绝评论
export function getCommentAdopts(data:any){
  return request(`/api/comment/${data.id}`,{
    method:"PATCH",
    data:data.obj
  })
}
// 删除评论
export function getCommentDelete(data:any){
  console.log(data);
  return request(`/api/comment/${data.id}`,{
    method:"DELETE",
    params:{
      data
    }
  })
}
// 回复评论
export function getCommentReply(data:any){
  console.log(data);
  return request(`/api/comment`,{
    method:"POST",
    data
  })
}